package Review;

public class Test14 {

	public static void main(String[] args) {
		int[] array={1,2,3,4,5,6};
		for(int k=0;k<array.length;k++)
		{
			System.out.print(array[k]);
		}	
		System.out.println();
		reOrderArray(array);
		for(int k=0;k<array.length;k++)
		{
			System.out.print(array[k]);
		}	
	}
	public static void reOrderArray(int[] array){
		if(array==null||array.length==0){
			return;
		}
		int i=0;
		int j=array.length-1;
		while(i<j){
			while((array[i]&1)!=0){
				i++;
			}
			while((array[j]&1)==0){
				j--;
			}
			if(i<j){
				int temp = array[i];
				array[i]=array[j];
				array[j] = temp;
			}
			
		}
	}

}
